package main

import (
	"math"
	"strings"
)

// 输出一个int32对应的二进制表示

func BinaryFormat(n int) string {
	a := uint64(n)
	sb := strings.Builder{}

	if n == 0 {
		sb.WriteString("0")
		return sb.String()
	}

	c := uint64(math.Pow(2, 63))

	for i := 0; i < 64; i++ {
		if c&a != 0 {
			sb.WriteString("1")
		} else {
			sb.WriteString("0")
		}
		c = c >> 1
	}

	return sb.String()

}

func main() {
	println(BinaryFormat(5))
	println(math.Pow(2, 63))
	//println(BinaryFormat(0))
	//println(BinaryFormat(342553435523634))
	//println(BinaryFormat(-342553435523634))
	//println(BinaryFormat(45556747656354))
}
